<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Remind</title>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/layui/css/layui.css">
    <!-- <link rel="stylesheet" href="css/page.css"> -->
    <style>
        body,
        html {
            width: 100%;
        }

        #wrap {
            width: 100%;
            background: #ccc;
            padding-bottom: 15px;
            /* border: 1px solid red; */
        }

        #top {
            width: 98%;
            height: 40px;
            background: #fff;
            font: 16px/40px "simhei";
            padding-left: 1.993355%;
            margin-bottom: 20px;
            overflow: hidden;
        }

        #top span:hover {
            opacity: 0.7;
        }

        /* 中间搜索和添加 */
        #center {
            height: 130px;
            width: 98.101567%;
            background: #ffff;
            margin-left: 0.956%;
        }

        .cen-1 div:nth-child(1),
        .cen-2 div:nth-child(1),
        .cen-3 div:nth-child(1),
        .cen-4 div:nth-child(1),
        .cen-5 div:nth-child(1),
        .cen-6 div:nth-child(1) {
            margin-right: 2%;
        }

        /* #center select, */
        #center input {
            border: none;
            outline: none;
            width: 85%;
            height: 83%;
            padding: 0;
            margin: 0;
            font: 14px/34px "simsun";
            text-align: center;
        }

        #center>div>div {
            float: left;
            border-radius: 5px;
        }

        .cen-1,
        .cen-2,
        .cen-3,
        .cen-4,
        .cen-5,
        .cen-6 {
            height: 37px;
            float: left;
            line-height: 37px;
            font-size: 14px;
            margin-left: 1.111272%;
            width: 20%;
            margin-top: 10px;
            margin-bottom: 10px;
            /* background: red; */
        }

        .cen-1 div:nth-child(1) {
            width: 35%;
            text-align: center;
            /* border:1px solid red; */
        }

        .cen-1 div:nth-child(2) {
            width: 53.67%;
            height: 37px;
            border: 1px solid #ccc;
            text-align: center;
            line-height: 37px;
            position: relative;
        }

        #center .cen-1 ul,
        #center .cen-2 ul,
        #center .cen-3 ul {
            width: 85%;
            margin-left: 10px;
            margin-top: 10px;
            position: relative;  
            z-index: 9;
            display: none;
           

        }

        #center .cen-2 ul{
            height:200px;
            overflow: auto;
        }
        #center .cen-1 ul li,
        #center .cen-2 ul li,
        #center .cen-3 ul li {
            height: 37px;
            width: 100%;
            border: 1px solid #ccc;
            font: 14px/37px "simsun";
            background: #fff;
            border: 1px solid #ccc;
            /* z-index: 999; */
            /* position: relative; */
            /* display: none; */
        }
        #center .cen-2 ul li{
            border-left:none;
            border-right:none;
        }
        #center .cen-1 ul li:hover {
            background: #ccc;
            color: #fff;
        }

        #center .cen-2 ul li:hover {
            background: #ccc;
            color: #fff;
        }

        #center .cen-3 ul li:hover {
            background: #ccc;
            color: #fff;
        }


        #center .cen-1 input {
            width: 65%;
            height: 37px;
        }

        .cen-2 div:nth-child(1) {
            width: 33%;
            text-align: center;
        }

        .cen-2 {
            width: 22%;
        }

        .cen-2 div:nth-child(2) {
            width: 55.67%;
            height: 37px;
            border: 1px solid #ccc;
            padding-left: 3px;
            text-align: center;
            line-height: 37px;
        }

        #center .cen-2 input {
            width: 65%;
            height: 37px;
        }

     .com{
            color: #ccc;
        }

        .cen-3 {
            width: 24%;
        }

        .cen-3 div:nth-child(1) {
            width: 40%;
            text-align: center;
            /* border:1px solid red; */
        }

        #center .cen-3 input {
            /* text-align: left; */
            width: 65%;
            height: 37px;
        }

        .cen-3 div:nth-child(2) {
            width: 50.67%;
            height: 37px;
            border: 1px solid #ccc;
            text-align: center;
            line-height: 37px;
        }

        .cen-4 {
            width: 28.6%;
        }

        .cen-4 div:nth-child(1) {
            width: 35%;
            text-align: center;
            /* border:1px solid red; */
        }

        .cen-4 div:nth-child(2) {
            width: 55.67%;
            height: 37px;
            border: 1px solid #ccc;
            text-align: center;
            line-height: 37px;
        }

        .cen-5 {
            width: 60%;
            margin-top: 10px;
        }

        .cen-5 div:nth-child(1) {
            width: 15%;
            text-align: center;
            /* border:1px solid red; */
        }

        .cen-5 div:nth-child(2) {
            width: 20.67%;
            height: 32px;
            border: 1px solid #ccc;
            margin-right: 3%;
            padding-top: 5px;
            text-align: center;
            line-height: 37px;
            padding-left: 5px;
        }

        .cen-5 div:nth-child(3) {
            width: 5%;
            color: #ccc;
        }

        .cen-5 div:nth-child(4) {
            width: 20.67%;
            height: 32px;
            border: 1px solid #ccc;
            text-align: center;
            line-height: 37px;
            padding-top: 5px;
            padding-left: 5px;
            position: relative;
            /* z-index: 9; */
        }

        .cen-6 {
            width: 7%;
            height: 37px;
            font: 14px/37px "simsun";
            background: #429788;
            color: #fff;
            text-align: center;
            margin-left: 27%;
            border-radius: 12px;
        }

        .cen-6:hover {
            opacity: 0.7;
        }

        /* table列表 */
        #btom {
            height: 700px;
            width: 98.101567%;
            background: #ffff;
            margin-left: 0.956%;
            margin-top: 15px;
            padding-top: 30px;
            margin-bottom: 30px;
            position: relative;
        }

        #btom-1 {
            width: 95%;
            height: 567px;
            margin-left: 2.5%;
            margin-right: 1.5%;
            overflow: hidden;
            position: relative;
        }

        #btom-tab {
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
        }

        .a2,
        .a3,
        .a4,
        .a7 {
            width: 10%;
        }

        .a4 {
            width: 14%;
        }

        .a1 {
            width: 6%;
        }

        .a5 {
            width: 30%
        }

        /* .a5- {
            width: 400px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-align: left;
        } */

        .a6 {
            width: 20%;
            /* line-height: 56px; */
        }

        .a6>div {
            float: left;
        }

        .a6>div:first-child {
            line-height: 56px;
            margin-left: 25%;
        }

        .a6- {
            width: 15%;
            height: 80%;
            /* background: red; */
            z-index: 10;
            margin-top: 5px;
        }

        .a6->div {
            width: 100%;
            height: 40%;
            margin-top: 5%;
            font-size: 12px;
        }

        .a6->div:first-child i {
            transform: rotateZ(-180deg);
            line-height: 14px;
            margin-top: 20%;

            /* color: red; */
        }

        #btom-tab tr td:nth-child(5) {
            text-align: left;
        }

        #btom-tab td {
            text-align: center;
            height: 50px;
            border: 1px solid #ebeef5;
            line-height: 50px;
            font-size: 14px;
            color: #686a6d;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #btom-tab tr:hover {
            background: #f5f7fa;
        }

        #btom-tab th {
            text-align: center;
            height: 55px;
            border: 1px solid #ebeef5;
            font-size: 16px;
            background: #f5f7fa;
            color: #606266;
        }

        /*提醒开关  */
        .on-off {
            /* display: inline-block; */
            width: 35px;
            height: 18px;
            background: red;
            float: left;
            margin-left: 15px;
            margin-top: 12px;
            border-radius: 15px;
            position: relative;
            margin-right: 10%;
        }

        .fa-trash-o {
            font-size: 20px;
        }

        .on-off-1 {
            width: 16px;
            height: 16px;
            position: absolute;
            top: 1px;
            left: 1px;
            border-radius: 50%;
            background: #fff;
        }

        /* 页码器 */
        #page {
            height: 50px;
            margin: 20px auto;
            color: #666;
            display: block;
            text-align: center;
            position: absolute;
            left: 35%;
            bottom: 0px;
        }

        #page li {
            display: inline-block;
            min-width: 28px;
            border-radius: 50%;
            height: 28px;
            cursor: pointer;
            color: #666;
            font-size: 13px;
            line-height: 28px;
            background-color: #f9f9f9;
            border: 1px solid #dce0e0;
            text-align: center;
            margin: 0 4px;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }

        .xl-nextPage,
        .xl-prevPage {
            border-radius: 50%;
            width: 28px;
            color: #0073A9;
            height: 28px;
        }

        #page li.xl-disabled {
            opacity: .5;
            cursor: no-drop;
        }

        #page li.xl-disabled:hover {
            background-color: #f9f9f9 !important;
            border: 1px solid #dce0e0 !important;
            color: #666 !important;
        }

        #page li.xl-active {
            background-color: #429788;
            border-color: #429788;
            color: #FFF
        }

        #page li:hover {
            background-color: #429788 !important;
            border-color: #429788;
            color: #FFF
        }

        #page li.xl-jumpText {
            background-color: rgba(0, 0, 0, 0);
            border-color: rgba(0, 0, 0, 0);
            opacity: 1;
        }

        #page li.xl-jumpText:hover {
            background-color: rgba(0, 0, 0, 0) !important;
            border-color: rgba(0, 0, 0, 0) !important;
        }

        #page li.xl-jumpButton {
            padding: 0 5px;
        }

        #xlJumpNum {
            border-radius: 50%;
            width: 28px;
            height: 28px;
            margin: 0 3px;
        }

        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none !important;
        }

        input[type="number"] {
            -moz-appearance: textfield;
        }

        #btom-p {
            position: relative;
            background: black;
            display: none;
            color: #fff;
            font: 12px/25px "simhei";
            z-index: 5;
            padding: 5px;
            position: absolute;
            left: 300px;
            border-radius: 7px;
        }

        .sanjiao {
            width: 0;
            height: 0;
            border-top: 20px solid black;
            border-left: 20px solid transparent;
            border-right: 20px solid transparent;
            position: absolute;
            left: 30%;
        }

        #wrap .active {
            color: red;
        }
    </style>
</head>

<body>

    <div id="wrap">
        <div id="top"><span>提醒功能</span></div>
        <div id="center">
            <div class="cen-1">
                <div>模块</div>
                <div>
                    <p class="P1">
                        <input type="text" id="MK" placeholder="模块"><i class="fa fa-chevron-down com"></i> </p>
                    <ul id="cen1-ul">
                        <li>
                            <option value="2">学生管理</option>
                        </li>
                        <li>
                            <option value="1">院校管理</option>
                        </li>

                    </ul>
                </div>

            </div>
            <div class="cen-2">
                <div>提醒人</div>
                <div>
                    <p class="P2">
                        <input type="text" id="TXR" placeholder="员工姓名"><i class="fa fa-chevron-down com"></i> </p>
                    <ul id="cen2-ul">
                      

                    </ul>
                </div>
            </div>
            <div class="cen-3">
                <div>提醒事项</div>
                <div>
                    <p class="P3">
                        <input type="text" id="TXSX" placeholder="提醒事项"><i class="fa fa-chevron-down com"></i> </p>
                    <ul id="cen3-ul">
                        <li>
                            <option value="1">待跟进量提醒</option>
                        </li>
                        <li>
                            <option value="2">转公共量提醒</option>
                        </li>
                        <li>
                            <option value="3">接受量提醒</option>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="cen-4">
                <div>提醒内容</div>
                <div>
                    <input type="text" placeholder="请输入提醒内容" id="TXNR">
                </div>
            </div>
            <div class="cen-5">
                <div>提醒时间</div>
                <div>
                    <!-- <input type="text" class="layui-input" id="beginday" placeholder="开始日期"> -->
                    <input type="text" placeholder="选择日期" class="layui-input" id="beginday">
                </div>
                <div>----</div>
                <div>
                    <input type="text" name="" placeholder="选择时间" class="layui-input" id="beginday1">
                </div>
            </div>
            <div class="cen-6">+添加提醒</div>
        </div>
        <div id="btom">
            <div id="btom-1">
                <div id="btom-p"><em></em>
                    <p class="sanjiao"></p>
                </div>
                <table id="btom-tab">
                    <tr>
                        <th class="a1">0</th>
                        <th class="a2">提醒人</th>
                        <th class="a3">模块</th>
                        <th class="a4">提醒事项</th>
                        <th>提醒内容</th>
                        <th class="a6">
                            <div> 提醒时间</div>
                            <div class="a6-">
                                <div class="a6-1 active"><i class="fa fa-chevron-down"></i></div>
                                <div class="a6-2"><i class="fa fa-chevron-down"></i></div>
                            </div>
                        </th>
                        <th class="a7">操作</th>
                    </tr>
                    <!-- <tr>
                        <td class="a1">1</td><td class="a2">狗子</td>
                        <td class="a3">学生管理</td>
                        <td class="a4">正在跟进事项</td>
                        <td class="a5">
                        需要跟进学生缴费情况
                        </td>
                        <td class="a6">2019-12-15 08:12:14</td>
                        <td class="a7">
                            <div class="on-off">
                                <div class="on-off-1"></div>
                            </div>
                            <i class="fa fa-trash-o"></i>
                        </td>
                    </tr>
                    <tr>
                        <td class="a1">2</td>
                        <td class="a2">狗子</td>
                        <td class="a3">学生管理</td>
                        <td class="a4">正在跟进事项</td>
                        <td class="a5">
                           
                                需要跟进学生缴费情况需要跟进学生缴费情况
                        </td>
                        <td class="a6">2019-12-15 08:12:14</td>
                        <td class="a7">
                            <div class="on-off">
                                <div class="on-off-1"></div>
                            </div>
                            <i class="fa fa-trash-o"></i>
                        </td>
                    </tr>
                    <tr>
                        <td class="a1">3</td>
                        <td class="a2">狗子</td>
                        <td class="a3">学生管理</td>
                        <td class="a4">正在跟进事项</td>
                        <td class="a5">
                                需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况
                        </td>
                        <td class="a6">2019-12-15 08:12:14</td>
                        <td class="a7">
                            <div class="on-off">
                                <div class="on-off-1"></div>
                            </div>
                            <i class="fa fa-trash-o"></i>
                        </td>
                    </tr>
                    <tr>
                        <td class="a1">4</td>
                        <td class="a2">狗子</td>
                        <td class="a3">学生管理</td>
                        <td class="a4">正在跟进事项</td>
                        <td class="a5">
                                需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况
                        </td>
                        <td class="a6">2019-12-15 08:12:14</td>
                        <td class="a7">
                            <div class="on-off">
                                <div class="on-off-1"></div>
                            </div>
                            <i class="fa fa-trash-o"></i>
                        </td>
                    </tr>
                    <tr>
                        <td class="a1">5</td>
                        <td class="a2">狗子</td>
                        <td class="a3">学生管理</td>
                        <td class="a4">正在跟进事项</td>
                        <td class="a5">
                                需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况
                        </td>
                        <td class="a6">2019-12-15 08:12:14</td>
                        <td class="a7">
                            <div class="on-off">
                                <div class="on-off-1"></div>
                            </div>
                            <i class="fa fa-trash-o"></i>
                        </td>
                    </tr>

                    <tr>
                        <td class="a1">6</td>
                        <td class="a2">狗子</td>
                        <td class="a3">学生管理</td>
                        <td class="a4">正在跟进事项</td>
                        <td class="a5">
                                需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况
                                需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况需要跟进学生缴费情况
                        </td>
                        <td class="a6">2019-12-15 08:12:14</td>
                        <td class="a7">
                            <div class="on-off">
                                <div class="on-off-1"></div>
                            </div>
                            <i class="fa fa-trash-o"></i>
                        </td>
                    </tr> -->

                </table>
            </div>
            <div id="page"></div>
        </div>
    </div>
</body>

</html>
<script src="js/jquery-3.4.1.js"></script>
<script src="js/ipUrl.js"></script>
<!-- <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> -->
<script type="text/javascript" src="js/xlPaging.js"></script>
<script src="css/layui/layui.js"></script>
<script>
    $(function(){
        var totalPage=10;
        AjaxData(1,1);
    })
    $(".a6-1").on('click',function(){
        $(this).addClass('active')
        $('.a6-2').removeClass('active')
        $("#btom-tab tr:eq(0)").siblings().remove();
        AjaxData(1,1);
    })
    $(".a6-2").on('click',function(){
        $('.a6-1').removeClass('active')
        $(this).addClass('active')

        $("#btom-tab tr:eq(0)").siblings().remove();
        AjaxData(2,1);
    })
    //请求AJAX渲染数据
    function AjaxData( PX, num){
        $.ajax({
            url:  readmiURL+":9999/oaSystem/remind",
            type: 'get',
            dataType: 'json',
            async:false,
            data: {
                method: 'remindAll',
                currentPage: num,
                rows: '10',
                asc:PX
            },
            success: function (data) {
                console.log("+++");
               console.log(data);
                totalPage=data.result.totalPage;
                console.log(data.result.totalPage);
              
                 // 页码使用方法
                $("#page").paging({
                    nowPage: num, // 当前页码
                    pageNum: totalPage, // 总页码
                    buttonNum: 6, //要展示的页码数量
                    canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
                    showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
                    callback: function (num) { //回调函数
                        // $(this).addClass('active')
                        $("#btom-tab tr:eq(0)").siblings().remove();
                         AjaxData(1,num);
                    }
                });
                for (i = 0; i < data.result.list.length; i++) {
                    function getLocalTime(nS) {
                        return new Date(parseInt(nS)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
                    }
                    if (data.result.list[i].moduleId == 1) {
                        data.result.list[i].moduleId = '学生管理'
                    } else {
                        data.result.list[i].moduleId = '院校管理'
                    }
                    if (data.result.list[i].remindTypeId == 1) {
                        data.result.list[i].remindTypeId = '待跟进量提醒'
                    } else if (data.result.list[i].remindTypeId == 2) {
                        data.result.list[i].remindTypeId = '转公共量提醒'
                    } else if (data.result.list[i].remindTypeId == 3) {
                        data.result.list[i].remindTypeId = '接受量提醒'
                    }
                    var tr = $('<tr></tr>').appendTo('#btom-tab');
                    tr.attr("remindid", data.result.list[i].remindId)
                    $('<td></td>').html(i + 1).appendTo(tr).addClass('a1');
                    $('<td></td>').html(data.result.list[i].empName).appendTo(tr).addClass('a2');
                    $('<td></td>').html(data.result.list[i].moduleId).appendTo(tr).addClass('a3');
                    $('<td></td>').html(data.result.list[i].remindTypeId).appendTo(tr).addClass('a4');
                    $('<td></td>').html(data.result.list[i].remindContent).appendTo(tr).addClass('a5');
                    $('<td></td>').html(getLocalTime(data.result.list[i].remindTime)).appendTo(tr).addClass('a6');
                    $("<td>").html('<div class="on-off" onOff4="' + data.result.list[i].remindState + '"><div class="on-off-1"></div></div><i class="fa fa-trash-o"></i>').addClass('a7').appendTo(tr);

                    if ($('#btom-tab tr').eq(-1).find('td div:eq(0)').attr('onOff4')== 1) {
                        $('#btom-tab tr').eq(-1).find('td div:eq(0)').css({ background: 'green' }).find(".on-off-1").animate({
                            left: '2px'
                        }, 500)
                    } else {
                        $('#btom-tab tr').eq(-1).find('td div:eq(0)').css({ background: 'red' }).find(".on-off-1").animate({
                            left: '16px'
                        }, 500)
                    }
                }
            },
            error: function (xhr, errorInfo) {
                console.log('-------');
            }
        });
    }


    //时间选择
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#beginday'
        });
    });
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#beginday1',
            type: 'time'
        });
    });
    //下拉菜单1
    var onOff1 = true;
    $(".cen-1").on('click', function () {
        if (onOff1 == true) {
            $(this).find(".fa-chevron-down").css({
                transform: 'rotateZ(-180deg)',
                transition: '0.3s'
            })
            onOff1 = false;
        } else {
            $(this).find(".fa-chevron-down").css({
                transform: 'rotateZ(-360deg)',
                transition: '0.3s'
            })
            onOff1 = true;
        }
        $("#cen1-ul").slideToggle(300);
    });

    //提醒人ajax请求
    $.ajax({
        url:  readmiURL+":9999/oaSystem/remind",
            type: 'get',
            dataType: 'json',
            data: {
                empId: '10001',
                method: 'remindEmp'
            },
            success: function (data) {
                console.log(data)
                $("#cen2-ul").html();
                for(i=0;i<data.result.length;i++){
                    // console.log(data.result[i].empName)
                    var liM=$("<li>").html('<option value="'+ data.result[i].empid +'">'+ data.result[i].empName +'</option>').appendTo('#cen2-ul') 
                }
            }
        })
    //下拉菜单2
    var onOff2 = true;
    $(".cen-2").on('click', function () {
        if (onOff2 == true) {
            $(this).find(".fa-chevron-down").css({
                transform: 'rotateZ(-180deg)',
                transition: '0.3s'
            })
            onOff2 = false;
        } else {
            $(this).find(".fa-chevron-down").css({
                transform: 'rotateZ(-360deg)',
                transition: '0.3s'
            })
            onOff2 = true;
        }
        $("#cen2-ul").slideToggle(300);
    });
    //下拉菜单3
    var onOff3 = true;
    $(".cen-3").on('click', function () {
        if (onOff3 == true) {
            $(this).find(".fa-chevron-down").css({
                transform: 'rotateZ(-180deg)',
                transition: '0.3s'
            })
            onOff3 = false;
        } else {
            $(this).find(".fa-chevron-down").css({
                transform: 'rotateZ(-360deg)',
                transition: '0.3s'
            })
            onOff3 = true;
        }
        $("#cen3-ul").slideToggle(300);
    });
   
    //删除tr
    $("#btom-tab").on('click', ".fa-trash-o", function () {
        var A = $(this).parent().parent().find("td:eq(0)").html();
        alert(A)
        $(this).parent().parent().siblings().find("td:eq(0)").each(function () {
            if ($(this).html() > A) {
                $(this).html($(this).html() - 1);
            }
        });
        $(this).parent().parent().remove();
        var remindId = $(this).parent().parent().attr('remindid');
        var AX = '3';
        ajaxState(remindId, AX)
        // window.location = ""
        $("#btom-tab tr:eq(0)").siblings().remove();
        AjaxData(1,1);
    })
    //添加提醒 
    $("#center").on('click', 'option',function () {
        $(this).parent().parent().siblings().find("input").val(this.innerHTML).attr('valnum',$(this).val())
    })
    $(".cen-6").on('click', function () {
        var SL = $("#btom-tab tr").length
        var MK = $("#MK").val();
        var TXR = $("#TXR").val();
        var TXSX = $("#TXSX").val();
        var TXNR = $("#TXNR").val();
        var D = $("#beginday").val();
        var T = $("#beginday1").val();
        if (MK !== '' && TXR !== '' && TXSX !== '' && TXNR !== '' & D !== '' && T !== '') {
              if( $("#MK").val()=='学生管理'){
                  var moduleId=1
              }else if($("#MK").val()=='院校管理'){
                var moduleId=2
              }
              if($("#TXSX").val()=='待跟进量提醒'){
                  var remindTypeId=1
              }else if($("#TXSX").val()=='转公共量提醒'){
                var remindTypeId=2
              }else if($("#TXSX").val()=='接受量提醒'){
                var remindTypeId=3
              }
       //添加提醒请求    
        $.ajax({ 
             url:  readmiURL+":9999/oaSystem/remind",
            type: 'get',
            dataType: 'json',
            data: {
                method: 'remindAdd',
                moduleId:  moduleId,   
                remindTypeId: remindTypeId,
                empId:$("#TXR").attr('valnum'),
                remindContent: $("#TXNR").val(),
                remindTime:$("#beginday").val()+' '+$("#beginday1").val()
            },
            success: function (data) {
                    console.log(data)
                    $("#MK").val('');
                    $("#TXR").val('');
                    $("#TXSX").val('');
                    $("#TXNR").val('');
                    $("#beginday").val('');
                    $("#beginday1").val('');
                    alert($("#TXR").attr('valnum'))
                    $("#btom-tab tr:eq(0)").siblings().remove();
                    AjaxData(1,1);
            },
            error: function () {
                alert('添加失败！');
              
            }
        });

        } else {
            alert("请输入完整内容")
            $("#MK").val('');
                    $("#TXR").val('');
                    $("#TXSX").val('');
                    $("#TXNR").val('');
                    $("#beginday").val('');
                    $("#beginday1").val('');
        }
        $(".fa-trash-o").on('click', function () {
            $(this).parent().parent().remove();
        })
    })
    //设置开关
   
    $("#btom-tab").on('click', '.on-off', function () {
        // console.log($(this).attr('onOff4'))
        if ($(this).attr('onOff4') == 2) {
            $(this).css({ background: 'green' }).find(".on-off-1").animate({
                left: '2px'
            }, 500);
            $(this).attr('onOff4',1);
        } else {
            $(this).css({ background: 'red' }).find(".on-off-1").animate({
                left: '16px'
            }, 500);
            $(this).attr('onOff4',2);
        }
        // console.log($(this).attr('onOff4'))
        var remindId = $(this).parent().parent().attr('remindid');
        var AXX = $(this).attr('onOff4');
        ajaxState(remindId, AXX)
    });
   

    //判断文字是否超出、、、显示文字
    $("#btom-tab").on('mouseover', '.a5', function () {
        var TEXT = $(this).html();
        var thisWidth = $(this).width();
        var wordWidth = $(this)[0].scrollWidth;
        var num = $(this).parent().children(".a1").html();
        var num1 = num * 42;
        if (wordWidth > thisWidth) {
            $("#btom-p em").html(TEXT)
            $("#btom-p").css({
                display: 'block',
                top: num1
            })
            var H = $("#btom-p").height();
            $(".sanjiao").css({
                top: H
            })
        } else {
            $("#btom-p").css({
                display: 'none'
            })
        }
    })
    $("#btom-tab").on('mouseout', '.a5', function () {
        $("#btom-p").css({
            display: 'none'
        })
    })

    
    //下拉框AJAX请求
    function ajaxState(remindID, State) {
        $.ajax({
            type: 'get',
            dataType: 'json',
            data: {
                method: 'remindUpdate',
                remindId: remindID,
                remindState: State
            },
            url:  readmiURL+":9999/oaSystem/remind",
            dateType: "json",
            success: function (data) {
                console.log(data)
            },
            error: function () {
                alert('失败！');
            }
        });
    }
</script>